using DEL.Gzh;
using IBLL.Gzh;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using Web.Models;

namespace Web.Controllers
{
    public class ZLYJController : Controller
    {
        IZLYJService _ys = BLLFactory.SetZLYJService();
        public IActionResult Index()
        {
            return View();
        }

        public IActionResult Add()
        {
            return View();
        }

        public IActionResult AddOrModify(ZLYJ item)
        {
            item.CreatedBy = 0;
            item.CreatedOn = DateTime.Now;
            item.UpdatedBy = 0;
            item.UpdatedOn = DateTime.Now;
            try
            {
                _ys.AddEntity(item);
                return Json(new { Result = "Success" });
            }
            catch (Exception ex)
            {
                return Json(new { Result = "Faild", Message = ex.Message });
            }
        }
    }
}